/*
 * Copyright (C) 2011 Project R'yleh Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.Arkham;

import com.Arkham.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.View.OnClickListener;
import android.widget.TextView;

public class Shop extends Activity implements OnClickListener 
{
	public  ViewCore GLView;
	
	TextView title;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		
		//removes title bar and sets the theme
        this.requestWindowFeature(Window.FEATURE_NO_TITLE); 
        
		super.onCreate(savedInstanceState);
		setContentView(com.Arkham.R.layout.storeentrance);
        
        View purchaseButton = findViewById(com.Arkham.R.id.purchase_button);
        purchaseButton.setOnClickListener(this);  
        View sellButton = findViewById(com.Arkham.R.id.sell_button);
        sellButton.setOnClickListener(this);
        View talkButton = findViewById(com.Arkham.R.id.talk_button);
        talkButton.setOnClickListener(this);  
        View exitButton = findViewById(com.Arkham.R.id.exit_button);
        exitButton.setOnClickListener(this); 
        
		title = (TextView) findViewById(R.id.schoolHouse_Text);
		title.setText("Student Store");
        
	}
	
    public void onClick(View v) {
    	Intent i;
    	switch (v.getId())
    	{
    	case com.Arkham.R.id.exit_button:
    	    finish();
    	    break;
    	case com.Arkham.R.id.purchase_button:
    		i = new Intent(this, ShopBuy.class);
    		startActivity(i);
    	    break;
    	case com.Arkham.R.id.sell_button:
    		i = new Intent(this, ShopSell.class);
   		    startActivity(i);
    	    break;
    	case com.Arkham.R.id.talk_button:
    	    i = new Intent(this, PopUpmsg.class);
    	    i.putExtra("whosays", "Store Clerk:");
    	    i.putExtra("says", "Hey, you going to buy anything or not?  I wanna go to lunch too ya know...");
    	    startActivity(i);
    	    break;
    	}
    }
}